<?php $sth = $dbh->prepare("SELECT name, colour FROM fruit"); $sth->execute(); $result = $q->fetchAll(PDO::FETCH_OBJ); //$result contains an array of stdObjects ?>